package com.mew.slots.core.game.mnyys.room;

import cn.hutool.core.util.RandomUtil;
import com.mew.slots.core.game.mnyys.dto.Mg;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;

/**
 * @author dylin
 * @create 2021/3/25
 */
public class MgUtil {
    private static final int[][] tierGolds={
            {24,30},
            {30,35},
            {35,40},
            {40,45},
            {50,55}
    };
    private static int[][][] mg_c={
            {
                    {1,0},
                    {0,1},
                    {1,1},
                    {0,1},
                    {0,1},
            },{
                    {0,1},
                    {0,1},
                    {1,1},
                    {0,1},
                    {0,1},
            },{
                    {0,1},
                    {0,1},
                    {0,1},
                    {1,0},
            },{
                    {0,1},
                    {0,1},
                    {1,0},
            },{
                    {1,0},
                    {0,1},
            }
    };
    /**
     * 初始化玫瑰集合
     */
    public static void initMgs(List<Mg> mgList, long bet){
        for (int i = 0; i < mg_c.length; i++) {
            int[][] tierMgs=mg_c[i];
            List<int[]> temp= Arrays.asList(tierMgs);
            Collections.shuffle(temp);
            for (int t = 0; t < temp.size(); t++) {
                Mg mg=new Mg();
                int[] mgs=temp.get(t);
                if(mgs[1]==1){
                    mg.setGold(RandomUtil.randomInt(tierGolds[i][0],tierGolds[i][1])*bet);
                }
                mg.setUp(mgs[0]);
                mgList.add(mg);
            }
        }
    }
}
